package com.zxy.ziems.server.device.pojo.dto;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Null;
import lombok.Data;

/**
 * @Copyright (C),
 * @ClassName: DeviceBaseDTO
 * @Author: yanzhiwei
 * @Description:
 * @Date: 2024/6/3 16:03
 */
@Data
public class DeviceBaseDTO<T> {
    /**
     * 主键
     */
    @Null(message = "新增设备，ID必须为空", groups = DeviceDTO.Add.class)
    @NotBlank(message = "设备ID不能为空", groups = {DeviceDTO.Update.class, DeviceDTO.Select.class})
    private String id;

    /**
     * 设备的编码
     */
    @NotBlank(message = "设备编码不能为空", groups = {DeviceDTO.Update.class, DeviceDTO.Add.class})
    private String code;

    /**
     * 设备名称
     */
    @NotBlank(message = "设备名称不能为空", groups = {DeviceDTO.Update.class, DeviceDTO.Add.class})
    private String name;

    /**
     * 通道ID
     */
    @NotBlank(message = "通道ID不可为空", groups = {DeviceDTO.Add.class})
    private String channelId;

    /**
     * 设备类型的Code
     */
    @NotBlank(message = "设备类型不能为空", groups = {DeviceDTO.Update.class, DeviceDTO.Add.class})
    private String type;


    public interface Add {
    }

    public interface Update {
    }

    public interface Select {
    }
}
